#! /bin/bash

# Author: Huoty <sudohuoty@163.com>
# CreateTime: 2020-08-18 12:27:20
# Script starts from here:

LIB_DIR=$HOME/.local/jsoncpp/lib
LIB_DIR2=/opt/jsoncpp/lib


CC="g++ -Wall -std=c++11"
if [[ `uname -s` == "Darwin" ]]; then
	CC="${CC} -stdlib=libc++"
fi

CFLAGS="-jsoncpp"
if [[ -d "$LIB_DIR" ]]; then
    CFLAGS="-L${LIB_DIR} ${CFLAGS}"
fi
if [[ -d "$LIB_DIR2" ]]; then
    CFLAGS="-L${LIB_DIR2} ${CFLAGS}"
fi

${CC} -L${LIB_DIR} -L${LIB_DIR2} -ljsoncpp $* && ./a.out
